package br.ufpe.cin.ip.biblioteca.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import br.ufpe.cin.ip.biblioteca.excecoes.ArquivoConfiguracaoNaoEncontradoException;

public class ArquivoUtil {
	private static final String fileName = "config.txt";
	
	public static String carregarTipoRepositorios() throws ArquivoConfiguracaoNaoEncontradoException {
		File file = new File(ArquivoUtil.fileName);
		Scanner scanner = null;
		
		try {
			scanner = new Scanner(file);
			return scanner.nextLine();
		} catch(FileNotFoundException e) {
			throw new ArquivoConfiguracaoNaoEncontradoException();
		} finally {
			scanner.close();
		}
	}
}
